home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue39 / Clinic / AddItemU.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-07-15  |  801 b   |  44 lines

  1. unit AddItemU;
  2.  
  3. interface
  4.  
  5. uses
  6.   WinTypes, WinProcs, Classes, Graphics, Forms, Controls, StdCtrls;
  7.  
  8. type
  9.   TForm1 = class(TForm)
  10.     Label1: TLabel;
  11.     edtGroup: TEdit;
  12.     Label2: TLabel;
  13.     btnCreate: TButton;
  14.     Label3: TLabel;
  15.     edtDesc: TEdit;
  16.     edtPath: TEdit;
  17.     Label4: TLabel;
  18.     Label5: TLabel;
  19.     edtParams: TEdit;
  20.     procedure btnCreateClick(Sender: TObject);
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.DFM}
  29.  
  30. uses
  31.   Dialogs, AddItmU2;
  32.  
  33. procedure TForm1.btnCreateClick(Sender: TObject);
  34. begin
  35.   if edtGroup.Text = '' then
  36.     MessageDlg('Group name cannot be blank.', mtError, [mbOK], 0)
  37.   else
  38.     CreateShortCut(edtGroup.Text, 'Shortcut to ' + edtDesc.Text,
  39.       edtPath.Text, edtParams.Text, '', '', 0, False)
  40. end;
  41.  
  42. end.
  43.  
  44.